function remSize() {
  let deviceWidth =
    document.documentElement.clientWidth ||
    window.innerWidth ||
    document.body.clientWidth;
  if (deviceWidth >= 750) {
    deviceWidth = 750;
  }
  if (deviceWidth <= 320) {
    deviceWidth = 320;
  }
  document.documentElement.style.fontSize = deviceWidth / 7.5 + "px";
  document.body.style.fontSize = 0.32 + "rem";
}

remSize();
window.addEventListener("resize", () => {
  remSize();
});
